package com.beok.android.joylife.utils;

import android.os.Handler;
import android.widget.ScrollView;

public class Singleton {
	private ScrollView scrollView;
	private Handler scrollViewHandler;
	private static Singleton instance = null;

	public static Singleton getInstance() {
		if (instance == null) {
			synchronized (Singleton.class) {
				if (instance == null) {
					instance = new Singleton();
				}
			}
		}
		return instance;
	}

	public void startScrollViewRunnable() {
		scrollViewHandler = new Handler();
		scrollViewHandler.post(scrollViewRunnable);
	}

	public void scrollView(ScrollView scrollView) {
		this.scrollView = scrollView;
	}

	public Runnable scrollViewRunnable = new Runnable() {

		@Override
		public void run() {
			// TODO Auto-generated method stub
			scrollView.scrollTo(0, 0);
		}
	};
}
